package com.jiyun.courselist.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiyun.model.Course;
import com.jiyun.vo.CourseVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CourseMapper extends BaseMapper<Course> {
    Page<CourseVo> findPage(Page<CourseVo> courseVoPage,@Param("co") CourseVo courseVo);

    @Select("select count(p.id) from quiz q , quiz_paper q1,paper p where q.id=q1.qid and q1.pid=p.id and q.id=1")
    Integer totleti(Integer id);

    @Select("select count(q.id) count from train t , train_quiz t1,quiz q where t.id=t1.tid and t1.qid=q.id and t.id=1")
    Integer finalti(Integer id);
}
